package org.jctc.els.modules.biz.mapper.projects;

import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.jctc.els.modules.biz.entity.projects.ElsProjects;
import org.jctc.els.modules.biz.excel.*;
import org.jctc.els.modules.biz.vo.ElsProjectFilesVO;
import org.jctc.els.modules.biz.vo.ElsProjectTeamAuditVO;

import java.util.List;

/**
 * 项目表;(els_projects)表数据库访问层
 *
 * @author : Ice
 * @date : 2022-6-21
 */
@Mapper
public interface ElsProjectsMapper extends BaseMapper<ElsProjects> {

    Page<ElsProjects> paginQuery(Page<ElsProjects> elsProjectsPage, String projectName, Integer year);

    Page<ElsProjectFilesVO> paginCategoryQuery(Page<ElsProjects> elsProjectsPage,
                                         @Param("projectCategory") Integer projectCategory,
                                         @Param("projectType") Integer projectType,
                                         @Param("projectName") String projectName,
                                         @Param("year") Integer year);

    Page<ElsProjectFilesVO> paginCategoryQueryByExpert(Page<ElsProjects> elsProjectsPage,
                                                       @Param("projectCategory") Integer projectCategory,
                                                       @Param("projectType") Integer projectType,
                                                       @Param("projectName") String projectName,
                                                       @Param("year") Integer year,
                                                       @Param("expertId") Long expertId);


    List<WorkersProjectsExcel> exportWorkersProjects(@Param("ew") Wrapper<ElsProjects> queryWrapper, Integer projectCategory, Integer projectType, Long expertId);

    List<PersonnelProjectsExcel> exportPersonnelProjects(@Param("ew") Wrapper<ElsProjects> queryWrapper, Integer projectCategory, Integer projectType, Long expertId);

    List<ExploitProjectsExcel> exportExploitProjects(@Param("ew") Wrapper<ElsProjects> queryWrapper, Integer projectCategory, Integer projectType, Long expertId);

    List<PurchaseProjectsExcel> exportPurchaseProjects(@Param("ew") Wrapper<ElsProjects> queryWrapper, Integer projectCategory, Integer projectType, Long expertId);

    List<ProduceProjectsExcel> exportProduceProjects(@Param("ew") Wrapper<ElsProjects> queryWrapper, Integer projectCategory, Integer projectType, Long expertId);

    List<ScienceProjectsExcel> exportScienceProjects(@Param("ew") Wrapper<ElsProjects> queryWrapper, Integer projectType, Long expertId);

    List<ElsProjects> selectProjects(IPage<ElsProjects> page, @Param("year") Integer year, @Param("projectNumber") String projectNumber
            , @Param("orgName") String orgName
            , @Param("projectName") String projectName
            , @Param("category1") String category1
            , @Param("category2") String category2
            , @Param("category3") String category3
            , @Param("projectLevel") String projectLevel
            , @Param("trainingCategory") String trainingCategory
            , @Param("trainingType") String trainingType
            , @Param("trainingMode") String trainingMode
            , @Param("deptApply") String deptApply
            , @Param("deptHost") String deptHost
            , @Param("orgBy") String orgBy
            , @Param("implementScope") String implementScope
            , @Param("purchaseCategory") String purchaseCategory
            , @Param("specializedCategory") String specializedCategory
            , @Param("openTime") String openTime
            , @Param("completionTime") String completionTime
            , @Param("projectType") Integer projectType
    );

    List<ElsProjects> selectBoundProjects(IPage<ElsProjects> page, @Param("teamId") String teamId, @Param("projectNumber") String projectNumber
            , @Param("orgName") String orgName
            , @Param("projectName") String projectName
            , @Param("category1") String category1
            , @Param("category2") String category2
            , @Param("category3") String category3
            , @Param("projectLevel") String projectLevel
            , @Param("trainingCategory") String trainingCategory
            , @Param("trainingType") String trainingType
            , @Param("trainingMode") String trainingMode
            , @Param("deptApply") String deptApply
            , @Param("deptHost") String deptHost
            , @Param("orgBy") String orgBy
            , @Param("implementScope") String implementScope
            , @Param("purchaseCategory") String purchaseCategory
            , @Param("specializedCategory") String specializedCategory
            , @Param("openTime") String openTime
            , @Param("completionTime") String completionTime);

    Page<ElsProjectTeamAuditVO> paginQueryTeamAudit(@Param("elsProjectsPage") Page<ElsProjectTeamAuditVO> elsProjectsPage,
                                                    @Param("projectName") String projectName,
                                                    @Param("year") Integer year,
                                                    @Param("projectCategory") Integer projectCategory,
                                                    @Param("userId") Long userId, @Param("teamId") Long teamId, @Param("status") Integer status);

    Page<ElsProjectTeamAuditVO> paginQueryAdminAudit(@Param("elsProjectsPage") Page<ElsProjectTeamAuditVO> elsProjectsPage,
                                                    @Param("projectName") String projectName,
                                                    @Param("year") Integer year,
                                                    @Param("projectCategory") Integer projectCategory, @Param("teamId") Long teamId,@Param("status") Integer status);

    List<ElsProjectTeamAuditVO> selectAdminProjectList(@Param("projectCategory") Integer projectCategory, @Param("year") Integer year);

    Page<ElsProjectFilesVO> paginCategoryQueryBySpecial(@Param("elsProjectsPage") Page<ElsProjects> elsProjectsPage, @Param("projectCategory") Integer projectCategory, @Param("projectType") Integer projectType, @Param("projectName") String projectName, @Param("year") Integer year, @Param("userId") Long userId);

    List<WorkersProjectsExcel> paginCategoryQueryByExpertExcel(Integer projectCategory, Integer projectType, String projectName, Integer year, Long userId);

    List<WorkersProjectsExcel> paginCategoryQueryBySpecialExcel(Integer projectCategory, Integer projectType, String projectName, Integer year, Long userId);

    List<WorkersProjectsExcel> paginCategoryQueryExcel(Integer projectCategory, Integer projectType, String projectName, Integer year);

    Page<ElsProjectFilesVO> paginCategoryQueryByDeptId(@Param("elsProjectsPage") Page<ElsProjects> elsProjectsPage, @Param("projectCategory") Integer projectCategory, @Param("projectType") Integer projectType, @Param("projectName") String projectName, @Param("year") Integer year, @Param("deptId") String deptId);

    List<ProduceProjectsExcel> paginCategoryQueryByExpertExcelProduct(Integer projectCategory, Integer projectType, String projectName, Integer year, Long userId);

    List<ProduceProjectsExcel> paginCategoryQueryBySpecialExcelProduce(Integer projectCategory, Integer projectType, String projectName, Integer year, Long userId);

    List<ProduceProjectsExcel> paginCategoryQueryExcelProduce(Integer projectCategory, Integer projectType, String projectName, Integer year);

    List<PurchaseProjectExcel> paginCategoryQueryByExpertExcelPurchase(Integer projectCategory, Integer projectType, String projectName, Integer year, Long userId);

    List<PurchaseProjectExcel> paginCategoryQueryBySpecialExcelPurchase(Integer projectCategory, Integer projectType, String projectName, Integer year, Long userId);

    List<PurchaseProjectExcel> paginCategoryQueryExcelPurchase(Integer projectCategory, Integer projectType, String projectName, Integer year);

    List<ExploitProjectsExcel> paginCategoryQueryByExpertExcelExploit(Integer projectCategory, Integer projectType, String projectName, Integer year, Long userId);

    List<ExploitProjectsExcel> paginCategoryQueryBySpecialExcelExploit(Integer projectCategory, Integer projectType, String projectName, Integer year, Long userId);

    List<ExploitProjectsExcel> paginCategoryQueryExcelExploit(Integer projectCategory, Integer projectType, String projectName, Integer year);

    List<PersonnelProjectsExcel> paginCategoryQueryByExpertExcelPersonnel(Integer projectCategory, Integer projectType, String projectName, Integer year, Long userId);

    List<PersonnelProjectsExcel> paginCategoryQueryBySpecialExcelPersonnel(Integer projectCategory, Integer projectType, String projectName, Integer year, Long userId);

    List<PersonnelProjectsExcel> paginCategoryQueryExcelPersonnel(Integer projectCategory, Integer projectType, String projectName, Integer year);
}